#ifndef PROCESS_TABLE_H_
#define PROCESS_TABLE_H_
#include "bitmap.h"
#include "table.h"
#include "../threads/synch.h"
#define MAX_THREADS 512

class AddrSpace;
class Condition;
class Table;
class Lock;
class Thread; 

class Process
{
	public:
		AddrSpace* space;
		int threadCounter;
		int processId;
		Table* threads;
		Process(AddrSpace *s);
		int remove(int i);
		int addThread(Thread *t);
		int executingThreads;
		int mailboxNum;
		Lock* processLock;
	
};

class ProcessTable
{
	public:
		ProcessTable();
		int processCounter;
		int spaceId;
		Table* processes;
		int addProcess(AddrSpace* p,Thread* t);
		int removeThread( int threadId);
		int sleepThread( );
		int wakeThread( );
		int addThread( Thread* t);
		int getRemainingThreads();
		int getExecutingThreads();
		int removeProcess();
		int lockProcess();
		int releaseProcess();
		void lockTable();
		void releaseTable();
		Lock* tableLock;

};
#endif
